﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="ES_ActivityRequest.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.ES_ActivityRequest" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc1" %>

<asp:Content ID="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">  

  <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
        
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">        
            <script type="text/javascript">
                function onTextChange(sender) 
                {
                    if (sender.get_value() == "") 
                    { sender.set_text("");}
                }            
                function openDetails(trainee_seq)
                {
                   radopen("ES_TrainingRequestApp.aspx?Sequence=" + trainee_seq,"RadWindow1");
                }
            </script>    
    </telerik:RadCodeBlock>
      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Panel6">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel6" LoadingPanelID="RadAjaxLoadingPanel2" /> 
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

       <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
    </telerik:RadAjaxLoadingPanel>    
    
    <asp:panel ID="Panel6" runat="server" >
    <table width="1000" cellpadding="0" cellspacing="0">
        <tr>
            <td valign = "top">
                
                <uc1:user ID="user1" runat="server" />
                
            </td>
            <td width="20" >
            </td>            
          </tr>         
        <tr>
        <td colspan = "3">
        <div class="moduleDivSlim1000x450">
        <div class="moduleDivBottom1000">
        <table align="center" width ="980px" >
        <tr>
            <td align="left" class="tableHeader">
                รายการสมัครเดินทางไปต่างประเทศ </td>
        </tr>
        </table>
        <table width ="980px" align="center">
        <tr>
        <td align="left">
        <asp:Panel ID="PanelGrid" 
            runat="server" 
            Height="380px" 
            ScrollBars="Auto" 
            Visible="true" 
            Width="969px">
                <telerik:RadGrid ID="RadGrid2" 
                    runat="server" 
                    AllowAutomaticDeletes="True" 
                    AllowFilteringByColumn="True" 
                    AllowMultiRowEdit="True" 
                    AllowMultiRowSelection="True" 
                    AllowPaging="True" 
                    AllowSorting="True" 
                    AutoGenerateColumns="False" 
                    EnableAJAX="True" 
                    EnableAJAXLoadingTemplate="True" 
                    GridLines="None" 
                    Height="360px" 
                    OnItemCommand="RadGrid2_ItemCommand" 
                    Skin="Outlook" 
                    Width="960px">
                    <MasterTableView 
                        AllowMultiColumnSorting="True" 
                        CellSpacing="-1" 
                        ClientDataKeyNames="Sequence" 
                        CommandItemDisplay="Top" 
                        DataKeyNames="Sequence" 
                        NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                        <CommandItemTemplate>
                            <table width="99%">
                                <tr>
                                    <td align="left">
                                       <asp:LinkButton ID="AddInstitute" 
                                            runat="server" 
                                            CommandName="AddData" 
                                            Visible="true">
                                            <img alt="" src="../Images/Buttons/AddRecord.gif" 
                                                style="border:0px;vertical-align:middle;" /> เพิ่มรายการใหม่
                                        </asp:LinkButton>
                                    </td>
                                    <td align="right">
                                    
                                    </td>
                                </tr>
                                <tr><td></td></tr>
                            </table>
                        </CommandItemTemplate>
                        <Columns>
                                        
                            <telerik:GridBoundColumn 
                                DataField="Sequence" 
                                UniqueName="Sequence" 
                                Visible="false">
                            </telerik:GridBoundColumn>
                            
                            <%--<telerik:GridTemplateColumn 
                               AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" 
                                DataField="training_course_descr" 
                                FilterControlWidth="100%" 
                                HeaderText="ชื่อกิจกรรม" 
                                ShowFilterIcon="false" 
                                UniqueName="training_course_descr">          
                                <ItemTemplate>              
                                    <asp:LinkButton ID="cmDetail" runat="server" ToolTip="สมัครเข้าร่วมกิจกรรม"
                                        Text='<%# Eval("training_course_descr") %>' 
                                        OnClientClick='<%# string.Format("return openDetails(\"{0}\");", Eval("train_seq")) %>'>
                                    </asp:LinkButton>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" Wrap="False" />               
                            </telerik:GridTemplateColumn>--%>                               
                             <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" DataField="act_descr" 
                                FilterControlWidth="100%" HeaderText="ชื่อกิจกรรม" ShowFilterIcon="false" 
                                UniqueName="act_descr" Visible="true">
                                <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                            </telerik:GridBoundColumn>
                            
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" 
                                DataFormatString="{0:d}" 
                                DataField="send_date" 
                                FilterControlWidth="100%" HeaderText="วันที่สมัคร" ShowFilterIcon="false" 
                                UniqueName="send_date" >
                                <HeaderStyle HorizontalAlign="Center" Wrap="False" Width="80px"/>
                            </telerik:GridBoundColumn> 
                            
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" DataField="date_activity_start" 
                                FilterControlWidth="100%" HeaderText="วันที่จัด" 
                                ShowFilterIcon="false"
                                DataFormatString="{0:d}"  
                                UniqueName="date_activity_start">
                                <HeaderStyle HorizontalAlign="Center" Width="80px" Wrap="False" />
                            </telerik:GridBoundColumn>
                            
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" DataField="upper_approve" 
                                FilterControlWidth="100%" HeaderText="ผลการพิจารณา&lt;BR&gt;(ผู้บังคับบัญชา)" ShowFilterIcon="false" 
                                UniqueName="upper_approve">
                                <HeaderStyle HorizontalAlign="Center" Wrap="False" Width="100px"/>
                            </telerik:GridBoundColumn>                           
                           <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" DataField="act_approve" 
                                FilterControlWidth="100%" HeaderText="ผลการพิจารณา&lt;BR&gt;(กจ.)" ShowFilterIcon="false" 
                                UniqueName="act_approve">
                                <HeaderStyle HorizontalAlign="Center" Wrap="False" Width="100px"/>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" DataField="Status" FilterControlWidth="100%" 
                                HeaderText="สถานะ" ShowFilterIcon="false" UniqueName="Status" Visible="false">
                                <HeaderStyle HorizontalAlign="Center" Width="50px" Wrap="False" />
                            </telerik:GridBoundColumn>  
                           
                        </Columns>                        
                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                </MasterTableView>
                    <ClientSettings AllowColumnHide="True" 
                        AllowColumnsReorder="True" 
                        EnableRowHoverStyle="True" 
                        ReorderColumnsOnClient="True">
                        <Scrolling AllowScroll="true" UseStaticHeaders="True" />
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                    </ClientSettings>
            </telerik:RadGrid>
        </asp:Panel>
        <asp:Panel ID="PanelAddData2" 
            runat="server"
            Height="380px"
            Visible="false" 
            width="980px" 
            align="center"
            ScrollBars="Vertical">
            <ul class="formList890px">
            <li>
                <table align="left" > 
                    <tr>
                    <td align ="right" valign ="top" style="width:220px" >
                        กิจกรรม :
                    </td>
                    <td align="left" colspan="2">
                        <telerik:RadComboBox 
                            runat="server" 
                            ID="cbActivity" 
                            AllowCustomText ="true" 
                            DataTextField="Name" 
                            DataValueField="Sequence" 
                            Filter ="Contains"
                            CausesValidation ="false"
                            OnClientTextChange = "onTextChange" 
                            AutoPostBack="true"
                            Onselectedindexchanged="cbActivity_SelectedIndexChanged"                                           
                            EmptyMessage = "...เลือกกิจกรรม..."
                            Width="400px" >
                        </telerik:RadComboBox>
                        <span class="validate">*</span>
                        <asp:RequiredFieldValidator runat="server" 
                            ID="RequiredFieldValidator1" 
                            ControlToValidate="cbActivity"
                            ErrorMessage="กรุณากรอกข้อมูลกิจกรรม" >
                        </asp:RequiredFieldValidator>
                    </td>
                </tr>
                </table>
            </li>                                
            <li>
                <table align="left" > 
                    <tr>
                       <td align="right" style="width:220px">
                            กิจกรรม :
                        </td>
                        <td align="left">
                            <asp:Label ID="lbActDescr" runat="server" ForeColor="Blue"></asp:Label>
                        </td>
                    </tr> 
                </table>
            </li>
            <li>
             <table align="left" > 
                <tr>
                   <td align="right" style="width:220px">
                           หน่วยงานที่จัดกิจกรรม :
                        </td>
                        <td align="left">
                            <asp:Label ID="lbJobsite" runat="server" ForeColor="Blue"></asp:Label>
                        </td>
                   </tr>
                </table>
            </li>                                
            <li>
            <table align="left" >
            <tr>
               <td align="right" style="width:220px">
                    เปิดรับสมัครตั้งแต่วันที่ :
                </td>
                
                <td class="style3" style="width: 130px" align="left">
                    <asp:Label ID="lbDateSignStard" runat="server" ForeColor="Blue"></asp:Label>
                </td>
                    
                <td align="right" class="style2" style="width: 40px">
                    ถึง
                </td> 
                <td align="left">
                    <asp:Label ID="lbDateSignEnd" runat="server" ForeColor="Blue"></asp:Label>
                </td>
            </tr>
            </table>
            </li>
            <li>
            <table align="left" >
            <tr>
               <td align="right" style="width:220px">
                    จัดกิจกรรมตั้งแต่วันที่ :
                </td>
                
                <td class="style3" style="width: 130px" align="left">
                    <asp:Label ID="lbDateActStard" runat="server" ForeColor="Blue"></asp:Label>
                </td>
                    
                <td align="right" class="style2" style="width: 40px">
                    ถึง
                </td> 
                <td align="left">
                    <asp:Label ID="lbDateActEnd" runat="server" ForeColor="Blue"></asp:Label>
                </td>
            </tr>
            </table>
            </li>                                                                    
                            
            <li>
             <table align="left" > 
                <tr>
                   <td align="right" style="width:220px">
                    จำนวนที่รับ :</td>
                
                <td align="left"> 
                    <asp:Label ID="lbActLimit" runat="server" ForeColor="Blue"></asp:Label>&#160;&#160;คน</td>
                </tr>
                </table>
            </li>                                    
            <li>
             <table align="left" > 
                <tr>
                   <td align="right" style="width:220px">
                        จำนวนผู้สมัคร :
                    </td>
                    <td align="left">
                        <asp:Label ID="lbTotalTrainee" runat="server" ForeColor="Blue"></asp:Label>&#160;&#160;คน
                    </td>
                </tr>
                    
                </table>
            </li>
            <li>
             <table align="left" > 
                <tr>
                   <td align="right" style="width:220px">
                        จำนวนผู้มีสิทธิ์เข้าร่วมกิจกรรม :
                    </td>
                    
                    <td align="left">
                        <asp:Label ID="lbAccepTrainee" runat="server" ForeColor="Blue"></asp:Label>&#160;&#160;คน
                    </td>
                </tr>
                </table>
            </li> 
            <li>
             <table align="left" > 
                <tr>
                   <td align="right" style="width:220px">
                            สถานที่ของการอบรม :
                        </td>
                        <td align="left">
                            <asp:Label ID="lbSchedule" runat="server" ForeColor="Blue"></asp:Label>
                        </td>
                   </tr>
                </table>
            </li> 
            <li>
                <table align="left" > 
                    <tr>
                       <td align="right" style="width:220px">
                            เมือง :
                        </td>
                        <td align="left"> 
                            <asp:Label ID="lbcity" runat="server" ForeColor="Blue"></asp:Label>
                        </td>
                    </tr> 
                </table>
            </li>
            <li>
                <table align="left" > 
                    <tr>
                       <td align="right" style="width:220px">
                            ประเทศ :
                        </td>
                        <td align="left">
                            <asp:Label ID="lbCountry" runat="server" ForeColor="Blue"></asp:Label>
                        </td>
                    </tr> 
                </table>
            </li>
            <li>
                <table align="left" > 
                    <tr>
                    <td align ="right" valign ="top" style="width:220px" >
                        ผู้บังคับบัญชา :
                    </td>
                    <td align="left" colspan="2">
                        <telerik:RadComboBox 
                            runat="server" 
                            ID="cbUpper" 
                            AllowCustomText ="true" 
                            DataTextField="Full_Name" 
                            DataValueField="EMP_SEQ" 
                            Filter ="Contains"
                            AutoPostBack="true"
                            CausesValidation ="false"
                            OnClientTextChange = "onTextChange"
                            EmptyMessage="... เลือกผู้บังคับบัญชา ..."
                            Width="360px" 
                            ZIndex="8000" Height="200px" >
                        </telerik:RadComboBox>
                        <span class="validate">*</span>
                        <asp:RequiredFieldValidator runat="server" 
                            ID="RequiredFieldValidator2" 
                            ControlToValidate="cbUpper"
                            ErrorMessage="กรุณากรอกข้อมูลกิจกรรม" >
                        </asp:RequiredFieldValidator>
                    </td>
                </tr>
                </table>
            </li>
            </ul> 
            <table style="width: 646px">
            <tr>                                    
            <td align="right" style="width: 321px">
                <asp:Button ID="btnSave2" onclick="btnSave2_Click" runat="server" CssClass="button" Text="ส่งใบสมัคร" Width="80px"/>   
                </td>
            <td align="left">
                <asp:Button ID="btnCancel2" OnClick="btnCancel2_Click" runat="server" CssClass="button" Text="ยกเลิก" Width="80px" CausesValidation="false" />
            </td>
            </tr>
            </table>
        
    </asp:Panel>
        </td>    
        </tr>            
        </table> 
        </div>
        </div>          
        </td>                                             
        </tr>         
    </table>
    </asp:Panel>
    
    <telerik:RadWindowManager ID="RadWindowManager1" VisibleStatusbar="false" ReloadOnShow="true"
        runat="server" Skin="Vista">
        <Windows>
        <telerik:RadWindow 
            id="RadWindow1" 
            runat="server"        
            showcontentduringload="false"
            VisibleStatusbar="false"
            AutoSize = "true"
            title="สมัครเข้ารับการอบรม"      
            Modal="true"
            behaviors="Close">
        </telerik:RadWindow>
    </Windows>        
    </telerik:RadWindowManager> 

</asp:Content>